home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
ezwindo1.zip
/
EZWINDO.DOC
< prev
next >
Wrap
Text File
|
1991-01-19
|
13KB
|
288 lines
The EZ-WINDOWS PullDown Menu System
"Terrific, a beautiful piece of programming!" - Duiven, Holland
A Complete Menu System for the QuickBasic 4.x Compiler
and MS Professional Development System 7.0 and up.
by
StrongSoft Engineering
3155 S.W. 178th Ave
Aloha, OR 97006
Documentation written & prepared by John C. Strong
OVERVIEW
This routine is intended to allow a programmer to present the user
with options in an organized and aesthetic way. The PullDown Menu System was
indeed modeled after the very pulldown menu used in the QuickBASIC 4.x
environment.
I wrote this routine out of frustration, actually. I didn't want to
take the time to write a pulldown menu routine, yet none of the commercially
available libraries offered the options that I needed. So I just sat down
one day and wrote it, and here it is.
The PullDown Menu System is very easy to integrate in a QB program,
yet offers all the options someone might expect in a commercial software
package. To use this routine in a program, all that is required is a few
arrays containing formatting information for the pulldown menu and an array
containing the actual text used. Then a simple CALL statement will take care
of the rest! Don't worry -- loading the arrays required for the routine is
very straightforward and uncomplicated, and the results are definitely worth
it!
The advantages of using this routine are both numerous and obvious, but
there is one disadvantage: the code size is rather large. But the programs
that need such a pulldown menu routine are the ones that need to present a
multitude of options to the user -- such a program will naturally be large
anyway, so the relative code size of the PullDown Menu System shouldn't make
a big difference.
REQUIREMENTS
The PullDown Menu System requires QuickBASIC 4.0 Compiler or above. I
don't know if it will work with earlier versions. I believe earlier versions
of QuickBASIC modify the stack a bit differently when passing parameters to
assembler routines, which would definitely cause problems. So if you don't
have version 4.0 or later, you would be doing yourself a great favor by
upgrading if for no other reason than to enjoy the benefits of a superior
programming environment provided by QB45 or PDS 7.0.
You can use this routine inside the QB environment or in a compiled
.EXE file. Two Quick Libraries are provided for program development inside
QB and two libraries are provided for compiled programs.
USING THE PULLDOWN MENU SYSTEM
Using this routine requires the dimensioning and loading of several
arrays and the actual call to the routine. When calling the routine, several
conventions must be observed:
1) All non-string variable arguments must be the integer type,
denoted by the percent sign %, i.e., ITEMSLCT%. Alternativ-
ely, the DEFINT statement can be used at the beginning of
your program which will take care of this automatically. You
can also pass literals instead of integer variables, but only
for arguments that are not modified by the routine. The best
thing to do is just pass variables, which requires less stack
space than literals.
2) The arguments passed must be in proper order or the routine
will not work, possibly locking up your system.
3) All arguments must be present or the routine will not work,
possibly locking up your system.
CALLING THE ROUTINE
This is the required format for calling this routine:
CALL PULLDOWN(MENUBAR$,MenuRow%,MenuCol%,MenuFG%, MenuBG%,HiliteFG%,
HiBarFG%,HiBarBG%,NonValidFG%,HiPos1%(),HiPos2%(),
MaxSize%(),MaxItems%(),item$(),valid%(),toggle%(),ms%,
ClearAfter%,Seed%,SoundOn%,Blink%,MenuSlct%,ItemSlct%)
Arguments: MENUBAR$ - A string variable holding each pulldown menu
name. The number of menus is determined by
the number of names is this string, which
must be separated by at least one space on
each side. A space character must be the last
character in the string.
MenuRow% - The row on which the menu bar will be
displayed.
MenuCol% - The column of the leftmost character in the
menu bar. For a full length menu bar, this
would be set to one (1).
MenuFG% - The foreground color of the menubar and menus.
MenuBG% - The background color of the menubar and menus.
HiLiteFG% - The foreground color of the 'hot' letter in
each selection. Bright white (15) or yellow
(14) work the best.
HiBarFG% - The foreground color of the text selected by
the hilite bar.
HiBarBG% - The background color of the hilite bar.
NonValidFG% - The foreground color of the selections not
currently valid. Gray (8) works the best here.
HiPos1%() - The integer array, dimensioned to the number of
menus, holding the position of the 'hot'
letter in each menu name in the MENUBAR$
variable. These letters will be hilited with
the color specified in the HiliteFG% variable.
HiPos2%() - A 2-dimensional integer array holding the
position of the 'hot' letter in each menu item
for each menu. It's first dimension is the
number of the menu, the second is the
number of the selection in the menu.
Dimension it for the number of menus and the
number of items in the largest menu. For
example,
DIM HiPos2%(menu%,slct%)
MaxSize%() - An integer array holding the length of the
longest item in each menu.
MaxItems%() - An integer array holding the number of items in
each menu.
Item$() - A 2-dimensional array holding the items for
selection for each menu. It is dimensioned
like HiPos2%(),
DIM Item$(menu%,slct%)
Valid%() - A 2-dimensional flag array that determines if
an item is valid for selection or not. A value
of 1 is valid; 0 means not valid, and the item
is grayed-out. It is dimensioned like
HiPos2%().
Toggle%() - A 2-dimension flag array that determines the
toggling status of each item in each menu.
2 - exclusive toggle, on
1 - inclusive toggle, on
0 - no toggling
-1 - inclusive toggle, off
-2 - exclusive toggle, off
If toggling is used in a menu, it must all be
of one type, either all exclusive or all
inclu